package com.mba.activity;

import java.util.ArrayList;
import java.util.List;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;

import com.mba.adapter.HomeListAdapter;
import com.mba.base.BaseActivity;
import com.mba.bean.Message;
import com.mba.service.MessageService;
import com.mba.util.Tools;

public class MainContentActivity extends BaseActivity{
	private ListView mainContentListView;
	private Tools tools;
	private Button writeReplies,backButton;
	private ArrayList<Message> contentList;
	private EditText writeReply;
	private MessageService msgService;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		NOTITLE();
		FULLSCREEN();
		setContentView(R.layout.main_content_activity);
		msgService = MessageService.getInstance();
		try {
			this.contentList = (ArrayList<Message>) this.msgService.getHomeTimeline(Tools.GET_LOCAL);
		} catch (Exception e) {
			e.printStackTrace();
		}
		this.backButton = (Button) findViewById(R.id.main_cotent_back_button);
		backButton.setOnClickListener( new OnClickListener() {
			
			@Override
			public void onClick(View arg0) {
				finish();
			}
		});
		writeReplies = (Button) findViewById(R.id.click_to_write_replies);
		writeReply  = (EditText) findViewById(R.id.writing_replies);
		writeReplies.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View arg0) {
				//点击切换语音或手写
				
			}
		});
		mainContentListView = (ListView) findViewById(R.id.main_content_lv);
		mainContentListView.setAdapter(new HomeListAdapter(this,contentList));
		
		
	}
	 
}
